#pragma once
#include "RBTreeGeneric.h"

namespace cxf
{
	template<class K>
	class set
	{
		struct SetKeyOfT
		{
			const K& operator()(const K& key)
			{
				return key;
			}
		};

	public:
		typedef typename RBTree<K, const K, SetKeyOfT>::Iterator iterator;
		typedef typename RBTree<K, const K, SetKeyOfT>::ConstIterator const_iterator;
		iterator begin()
		{
			return _root.Begin();
		}
		iterator end()
		{
			return _root.End();
		}
		const_iterator begin() const
		{
			return _root.Begin();
		}
		const_iterator end() const
		{
			return _root.End();
		}
		std::pair<iterator, bool> insert(const K& key)
		{
			return _root.Insert(key);
		}
		bool erase(const K& key)
		{
			return _root.Erase(key);
		}
		int size()
		{
			return _root.Size();
		}
		iterator find(const K& key)
		{
			return _root.Find(key);
		}
	private:
		RBTree<K, const K, SetKeyOfT> _root;
	};
}